<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>在此处插入标题</title>
 <link rel="stylesheet" href="../lib/layui/css/layui.css">
 <script src="../lib/layui/layui.js"></script>
</head>
<body>
		<div class="layui-body">
	    <form class="layui-form" action="zhuyexinxi.html"> 
	 
	   <div class="layui-form-item">
	    <label class="layui-form-label">姓名</label>
	    <div class="layui-input-block">
	      <input id="name" type="text" name="Name" placeholder="请输入" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  
	  <div class="layui-form-item layui-form-text">
	    <label class="layui-form-label">请填写简介</label>
	    <div class="layui-input-block">
	      <textarea id="jianjie" placeholder="请输入内容" class="layui-textarea"></textarea>
	    </div>
	  </div>
	 
	  <div class="layui-form-item layui-form-text">
	    <label class="layui-form-label">请填写事件</label>
	    <div class="layui-input-block">
	      <textarea id="shijian" placeholder="请输入内容" class="layui-textarea"></textarea>
	    </div>
	  </div>
	  <div class="layui-form-item">
	    <div class="layui-input-block">
	      <button class="layui-btn" lay-submit lay-filter="sub">立即提交</button>
	    </div>
	  </div>
	  
	</form>

  </div>
	<script src="../lib/layui/layui.js"></script>
	<script src="../js/jquery-1.8.2.js"></script>
	
	<script type="text/javascript">
	  function getQueryString(name) {
	   var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
	   var url = decodeURI(decodeURI(window.location.search))
	   var r = url.substr(1).match(reg);
	   if (r != null)
	    return unescape(r[2]);
	   return null;
	  }
	  $(document).ready(function() {
	   
	   var name = getQueryString("Name");
	   var jianjie = getQueryString("jianjie");
	   var shijian = getQueryString("shijian");
	  
	   

	   //方法一 :query赋值

	   $("#name").val(name);
	  $("#jianjie").val(jianjie);
	   $("#shijian").val(maxim);
	 

	  });
	</script>
		<script>
	
	//JavaScript代码区域
		layui.use([ 'form', 'table','element','layer' ], function() {
			var form = layui.form;
			var table = layui.table;
			var layer = layui.layer;
			var element=layui.element;
			var $ = layui.$;

			//submit提交事件
			form.on('submit(sub)', function(data) {
				console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
				var id = getQueryString("id");
				data.field.id = id;
				
				$.ajax({
					url : '../zyup',
					type : "get",
					data : data.field,
					success : function(qwe) {

						layer.msg(qwe.msg);

					},

				});

				//return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
			});

		})
	</script>
	</script>
		
</body>
</html>